package Transcation_anno.Service;

import Transcation_Xml.Dao.AccountDao;
import Transcation_Xml.Service.AccountService;
import Transcation_anno.Dao.AcountDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class AccountServiceImpl implements AccountInterface {
    @Autowired
    private AcountDao accountDao;
    @Transactional(isolation = Isolation.READ_COMMITTED,propagation = Propagation.REQUIRED)
    public void transfer(String outMan, String inMan, double money) {
        accountDao.In(inMan,money);
//        int i=1/0;
        accountDao.Out(outMan,money);
    }
}
